package Practice03_exam;

import java.util.Scanner;

public class StudentTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Student[] students = new Student[3];

        for (int i = 0; i < 3; i++) {
        System.out.println("请输入三个学生的学号，姓名，成绩");
            int number = scanner.nextInt();
            String name = scanner.next();
            int score = scanner.nextInt();
            students[i] = new Student(number,name,score);
        }

        int maxScore = students[0].getScore();
        int bestStudentId = 0;
        for (int i = 1; i < 3; i++) {
            if (students[i].getScore() > maxScore){
                bestStudentId = i;
            }
        }


        System.out.println("最牛的是"+students[bestStudentId]);
        for (int i = bestStudentId+1; i < 3; i++) {
            if (students[i].getScore() == students[bestStudentId].getScore()){
                System.out.println("最牛的是"+students[i]);
            }
        }

        int[][] arr = {{1,2,3},{4,5,6}};
        for (int[] a: arr
             ) {
            for (int b: a
                 ) {
                System.out.println(b);

            }

        }
    }
}
